import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

extension AssetsImg on String {
  Widget assetsImg({
    double? width,
    double? height,
    BoxFit? fit,
    Color? color,
  }) {
    return Image.asset("assets/images/$this.png",
      width: width, height: height, fit: fit, color: color);
  }

  Widget text({
    double fontSize = 14,
    Color? color,
    FontWeight? fontWeight
  }){
    return Text(this, style: TextStyle(
      fontSize: fontSize.sp,
      color: color ?? const Color(0xFF333333),
      fontWeight: fontWeight));
  }

}

// extension on number
extension ToSizedBox on double {
  Widget hSizedBox() {
    return SizedBox(
      height: this
    );
  }

  Widget wSizedBox() {
    return SizedBox(
      width: this
    );
  }
}